﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace DeltaPlcSystem
{
    public partial class PasswordForm : Form
    {
        public delegate void PwDele();
        public event PwDele pwEvent;
        public PasswordForm()
        {
            InitializeComponent();
            MaximizeBox = false;
        }

    

        private void uiButton1_Click(object sender, EventArgs e)
        {
            if (uiTextBox1.Text == Form1.Password)
            {

                if (uiTextBox2.Text != null && uiTextBox2.Text != "" && uiTextBox2.Text != string.Empty)
                {
                    Form1.Password = uiTextBox2.Text;
                    pwEvent();


                    MessageBox.Show("更新密码成功");

                    this.Close();
                }
                else { MessageBox.Show("新密码不能为空"); }



            }
            else { MessageBox.Show("原始密码有误"); }
        }


      
    }
}
